@model Test.Site.Data.Models.MenuItem
    @using Test.Utility.Extensions

<li class="@(Model.IsActive ? "active" : "")">
    @{
        string url = (Model.Action.IsNullOrWhiteSpace() || Model.Controller.IsNullOrWhiteSpace())
            ? "#"
            : Url.Action(Model.Action, Model.Controller);
    }
    <a href="@url">
        <i class="fa @Model.CssClass"></i>
        @Model.MenuItemName
    </a>
    @if (Model.ChildrensMenuItem.Any())
    {
        <ul class="sub-menu">
            @foreach (var subMenuItem in Model.ChildrensMenuItem)
            {
                @Html.Partial("_MenuItem", subMenuItem)
            }
        </ul>
    }
</li>